package com.ag.hmk.action;

import com.ag.bean.TbAidgoodsku;
import com.ag.common.BaseAction;
import com.ag.hmk.service.impl.AidGoodskuServImpl;
/**
 * 
 * @author hmk
 * 实现物资库信息的删除
 */
public class DelAgkuAction extends BaseAction {

	private static final long serialVersionUID = 634211321L;
	
	private AidGoodskuServImpl aidGoodskuServImpl;
	
	private String agkuID1; //物质库ID
	private String delStr;  //返回值，标志是否删除成功
	
	/*
	 * 删除物资库
	 */
	public String delAGKU()throws Exception{
		try {
			TbAidgoodsku agku = aidGoodskuServImpl.findByID(agkuID1);
			if (agku!=null) {
				aidGoodskuServImpl.delete(agku);
				this.setDelStr("1");
			} else {
				this.setDelStr("0");
			}
			
		} catch (Exception e) {
			e.printStackTrace();
			this.setDelStr("0");
		}
		
		return "delAGKUok";
	}
	
	public String getDelStr() {
		return delStr;
	}
	public void setDelStr(String delStr) {
		this.delStr = delStr;
	}
	public void setAidGoodskuServImpl(AidGoodskuServImpl aidGoodskuServImpl) {
		this.aidGoodskuServImpl = aidGoodskuServImpl;
	}
	public void setAgkuID1(String agkuID1) {
		this.agkuID1 = agkuID1;
	}

}
